const db = require('../db/index');

exports.getReminders = (req, res) => {
  // 这里需要实现关联数据查询和个性化提醒生成逻辑
  const userId = req.user.id;
  // 示例：查询日程安排并生成提醒
  const sql = 'SELECT * FROM schedules WHERE user_id = ? AND start_time > NOW()';
  db.query(sql, [userId], (err, results) => {
    if (err) return res.cc(err);
    const reminders = results.map(schedule => {
      return `日程提醒：${schedule.title} 将于 ${schedule.start_time} 开始`;
    });
    res.send({
      status: 0,
      message: '获取提醒成功',
      data: reminders
    });
  });
};